<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Kalnoy\Nestedset\NodeTrait;

//引入NodeTrait
class Menu extends Model
{
    use HasFactory, NodeTrait;

    public $fillable = ['id', 'parent_id', 'icon', 'meta', 'name', 'path', '_lft', '_rgt', "component", "hidden"];
    public $casts = [
        'meta' => 'array'
    ];
    public $hidden = ['created_at', 'updated_at', '_lft', '_rgt'];
}
